#include "Extent.h"

Extent::~Extent(void)
{
}

bool Extent::operator== (Extent &b) const{
	//cout<<" in extent =="<<endl;
	if (my_lun->getM_uid() == b.getLun()->getM_uid()){
		if (my_offset == b.my_offset)
			return true;
		else
			return false;
	}
	else
		return false;
}

bool Extent::operatorEqual (Extent &b) const{
	//cout<<" in extent equals"<<endl;
	if (my_lun->getM_uid() == b.getLun()->getM_uid()){
		if (my_offset == b.my_offset)
			return true;
		else
			return false;
	}
	else
		return false;
}

bool Extent::operator> (Extent &b) const
{
	if (my_lun->getM_uid() > b.getLun()->getM_uid())
	{
		return true;
	}
	else if (my_lun->getM_uid() == b.getLun()->getM_uid())
	{
		if (my_offset > b.my_offset)
		{
			return true;
		}
	}
	return false;
}

bool Extent::operator< (Extent &b) const
{
	if (my_lun->getM_uid() < b.getLun()->getM_uid())
	{
		return true;
	}
	else if (my_lun->getM_uid() == b.getLun()->getM_uid())
	{
		if (my_offset < b.my_offset)
		{
			return true;
		}
	}
	return false;
}

